﻿using FluentNHibernate.Mapping;
using cludg.Domain.Users;

namespace cludg.Repository.NHibernate.Config.Security
{
	internal class UserMap : ClassMap<User>
	{
		public UserMap()
		{
			Table("Users");
			Cache.ReadWrite();
			Not.LazyLoad();
			Id(x => x.Id).Length(50)
				.GeneratedBy.Custom<Utils.IdentifierGenerator>();
			Map(x => x.DisplayName).Length(100);
			Map(x => x.Email).Length(100);
			Map(x => x.CreationDate);
			Map(x => x.Location).Length(200);
			Map(x => x.Avatar).Length(50);
			Map(x => x.SmallAvatar).Length(50);
			Map(x => x.DateOfBirth);
			Map(x => x.Role);
			Map(x => x.UniqueName).Length(200);
		}
	}
}
